<template>
  <el-dialog title="预览" :visible.sync="visible" v-if="visible">
    <Article :article="article"/>
  </el-dialog>
</template>

<script>
import Article from '@/components/Article'
export default {
  name: 'ArticlePreview',
  components: { Article },
  data () {
    return {
      visible: false,
      article: {}
    }
  },
  methods: {
    init (articleId) {
      this.visible = true
      this.$http.get(`/admin/article/info/${articleId}`).then(data => {
        this.article = { ...data.data }
      })
    }
  }
}
</script>

<style scoped>

</style>
